//
//  YZPigGroupDeathDetailRecordImgCell.m
//  VET
//
//  Created by YZ on 2018/7/24.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZPigGroupDeathDetailRecordImgCell.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import "YZVideoPlayer.h"

@interface YZPigGroupDeathDetailRecordImgCell ()

@property (nonatomic, strong) UIImageView *imgView;

@end

@implementation YZPigGroupDeathDetailRecordImgCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame]){
        self.layer.masksToBounds = YES;
        [self.contentView addSubview:self.imgView];
        [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self).insets(UIEdgeInsetsZero);
        }];
    }
    return self;
}

#pragma mark -- setters && getters

- (UIImageView *)imgView
{
    if(!_imgView){
        _imgView = [UIImageView new];
    }
    return _imgView;
}


- (void)setModel:(YZPigGroupDeathDetailRecordAttachmentModel *)model
{
    _model = model;
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:model.attachmentUrl] placeholderImage:nil options:SDWebImageRetryFailed completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
        self.model.currentImg = image;
        NSLog(@"进来了");
    }];
}
@end
